Support multi-schema introspection in common.ai SQLToolset#68103
Merged
kaxil merged 1 commit intoJun 6, 2026
Conversation
SQLToolset's metadata tools (list_tables, get_schema) operated against a single
schema, so an agent over a multi-schema warehouse (common on Snowflake) could
not discover tables across schemas. With no schema set and schema-qualified
tables, list_tables introspected a literal "None" schema
(SHOW TABLES IN SCHEMA "DB"."None") and failed outright.
allowed_tables entries may now be schema-qualified ("SCHEMA.TABLE"). list_tables
introspects each referenced schema and returns the matching tables fully
qualified, and get_schema routes each qualified name to its own schema.
Unqualified entries and the allow-all case keep the previous single-schema
behaviour using the default schema. Table-name matching is case-insensitive,
because databases reflect identifiers in their own case (Snowflake reflects
unquoted names lowercased) and a byte-exact match would silently return nothing.
Results are de-duplicated by (schema, table) so a table reachable both qualified
and via the default schema is listed once.
9fecd5d to
077ef05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The common.ai
SQLToolsetmetadata tools (list_tables,get_schema) operated against a singleschema, so an agent over a multi-schema warehouse (common on Snowflake) could not discover tables across schemas. With noschemaset and schema-qualified tables,list_tablesintrospected a literal"None"schema (SHOW TABLES IN SCHEMA "DB"."None") and failed.allowed_tablesentries may now be schema-qualified ("SCHEMA.TABLE").list_tablesintrospects each referenced schema and returns the matching tables fully qualified, andget_schemaroutes each qualified name to its own schema.How it works
list_tablesqueries each schema and emitsSCHEMA.TABLEnames, filtered to the allow-list.get_schema("SCHEMA.TABLE")splits the identifier and passes the schema to the hook.schema, so existing setups are unchanged.(schema, table)so a table reachable both qualified and via the default schema is listed once.Usage
Gotchas